home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 137 / cd-rom 137.iso / aplic / gantt / ganttproject-2.0.2.exe / net.sourceforge.ganttproject_2.0.0 / data / resources / xslfo / ganttproject.xsl
Encoding:
Extensible Markup Language  |  2006-08-08  |  16.7 KB  |  477 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <xsl:stylesheet
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:fo="http://www.w3.org/1999/XSL/Format"
  6.     xmlns:ganttproject="http://ganttproject.sf.net/"
  7.     version="1.0">
  8.  
  9.  
  10. <!-- Basic Theme for PDF export from Ganttproject
  11.      ALexandre THOMAS
  12.          Septembre 2003 -->
  13.  
  14. <xsl:variable name="font" select="'sans-serif'"/>
  15. <xsl:template match="ganttproject:report">
  16.   <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  17.  
  18.     <fo:layout-master-set>
  19.       <!-- layout information -->
  20.       <fo:simple-page-master master-name="simple"
  21.                     page-height="29.7cm"
  22.                     page-width="21cm"
  23.                     margin-top="1cm"
  24.                     margin-bottom="1cm"
  25.                     margin-left="1.75cm"
  26.                     margin-right="1.75cm">
  27.         <fo:region-body margin-top="1cm"/>
  28.         <fo:region-before extent="1cm"/>
  29.         <fo:region-after extent="1cm"/>
  30.       </fo:simple-page-master>
  31.     </fo:layout-master-set>
  32.     <!-- end: defines page layout -->
  33.  
  34.  
  35.         <fo:page-sequence master-reference="simple">
  36.  
  37.         <!-- pied de page -->
  38.         <fo:static-content flow-name="xsl-region-after">
  39.       <fo:block text-align="right"
  40.           font-size="9pt" line-height="1em + 15pt">
  41.  
  42.           <xsl:attribute name="font-family">
  43.               <xsl:value-of select="$font"/>
  44.           </xsl:attribute>
  45.           page <fo:page-number/> - GanttProject
  46.       </fo:block>
  47.         </fo:static-content>
  48.  
  49.          <fo:flow flow-name="xsl-region-body">
  50.  
  51.             <fo:block font-size="15pt"
  52.                 line-height="24pt"
  53.                 space-after.optimum="15pt"
  54.                 color="black"
  55.                 text-align="center"
  56.                 padding-top="3pt">
  57.                 <xsl:attribute name="font-family">
  58.                     <xsl:value-of select="$font"/>
  59.                 </xsl:attribute>
  60.  
  61.                 <xsl:apply-templates select="ganttproject:project"/>
  62.              </fo:block>
  63.             
  64.              
  65.              <fo:block font-size="10pt"
  66.                 line-height="24pt"
  67.                 space-after.optimum="15pt"
  68.                 color="black"
  69.                 text-align="center"
  70.                 padding-top="2pt"
  71.                         padding-bottom="5pt">
  72.                 <xsl:attribute name="font-family">
  73.                     <xsl:value-of select="$font"/>
  74.                 </xsl:attribute>
  75.                 <xsl:apply-templates select="ganttproject:tasks"/>
  76.              </fo:block>
  77.              
  78.              
  79.              <fo:block font-size="10pt"
  80.                 line-height="24pt"
  81.                 space-after.optimum="15pt"
  82.                 color="black"
  83.                 text-align="center"
  84.                 padding-top="2pt">
  85.                  <xsl:attribute name="font-family">
  86.                      <xsl:value-of select="$font"/>
  87.                  </xsl:attribute>
  88.                 <xsl:apply-templates select="ganttproject:resources"/>
  89.              </fo:block>
  90.              
  91.              
  92.              <fo:block font-size="10pt"
  93.                 line-height="24pt"
  94.                 space-after.optimum="15pt"
  95.                 color="black"
  96.                 text-align="center"
  97.                 padding-top="3pt">
  98.                  <xsl:attribute name="font-family">
  99.                      <xsl:value-of select="$font"/>
  100.                  </xsl:attribute>
  101.                 <xsl:apply-templates select="ganttproject:ganttchart"/>
  102.              </fo:block>
  103.  
  104.              <fo:block font-size="10pt"
  105.                 line-height="24pt"
  106.                 space-after.optimum="15pt"
  107.                 color="black"
  108.                 text-align="center"
  109.                 padding-top="3pt">
  110.                  <xsl:attribute name="font-family">
  111.                      <xsl:value-of select="$font"/>
  112.                  </xsl:attribute>
  113.                 <xsl:apply-templates select="ganttproject:resourceschart"/>
  114.              </fo:block>
  115.       </fo:flow>
  116.     </fo:page-sequence>
  117.   </fo:root>
  118. </xsl:template>
  119.  
  120.  
  121. <!-- ========================================== Project settings ========================================== -->
  122. <xsl:template match="ganttproject:project">
  123.  
  124.     <fo:block font-size="20pt"
  125.               line-height="16pt"
  126.               background-color="#145277"
  127.               color="white"
  128.               space-after.optimum="15pt"
  129.               text-align="center"
  130.               padding-top="8pt"
  131.               padding-bottom="8pt">
  132.         <xsl:attribute name="font-family">
  133.             <xsl:value-of select="$font"/>
  134.         </xsl:attribute>
  135.          <xsl:apply-templates select="@title"/>
  136.     </fo:block>
  137.  
  138.     <fo:block font-size="10pt"
  139.               line-height="1pt"
  140.               color="#145277"
  141.               space-after.optimum="2pt"
  142.               text-align="left"
  143.               padding-top="15pt">
  144.         <xsl:attribute name="font-family">
  145.             <xsl:value-of select="$font"/>
  146.         </xsl:attribute>
  147.         <xsl:apply-templates select="@name"/>
  148.         <xsl:text> : </xsl:text>        
  149.         <xsl:apply-templates select="@nameValue"/>        
  150.     </fo:block>    
  151.     
  152.     <fo:block font-size="10pt"
  153.               line-height="1pt"
  154.               color="#145277"
  155.               space-after.optimum="2pt"
  156.               text-align="left"
  157.               padding-top="15pt">
  158.         <xsl:attribute name="font-family">
  159.             <xsl:value-of select="$font"/>
  160.         </xsl:attribute>
  161.         <xsl:apply-templates select="@organisation"/>
  162.         <xsl:text> : </xsl:text>    
  163.         <xsl:apply-templates select="@organisationValue"/>        
  164.     </fo:block>    
  165.  
  166.     <fo:block font-size="10pt"
  167.               line-height="1pt"
  168.               color="#145277"
  169.               space-after.optimum="2pt"
  170.               text-align="left"
  171.               padding-top="15pt">
  172.         <xsl:attribute name="font-family">
  173.             <xsl:value-of select="$font"/>
  174.         </xsl:attribute>
  175.         <xsl:apply-templates select="@webLink"/>
  176.         <xsl:text> : </xsl:text>    
  177.         <xsl:apply-templates select="@webLinkValue"/>        
  178.     </fo:block>    
  179.     
  180.     <fo:block font-size="10pt"
  181.               color="#145277"
  182.               space-after.optimum="2pt"
  183.               text-align="left"
  184.               padding-top="15pt">
  185.         <xsl:attribute name="font-family">
  186.             <xsl:value-of select="$font"/>
  187.         </xsl:attribute>
  188.         <xsl:apply-templates select="@description"/>
  189.         <xsl:text> : </xsl:text>    
  190.         <xsl:value-of select="desctiptionValue"/>         
  191.     </fo:block>
  192.      
  193.      
  194.      <fo:block font-size="10pt"
  195.                         line-height="1pt" color="#145277"
  196.                         space-after.optimum="2pt" text-align="left"
  197.                         padding-top="15pt">
  198.          <xsl:attribute name="font-family">
  199.              <xsl:value-of select="$font"/>
  200.          </xsl:attribute>
  201.                 <xsl:text>Date : </xsl:text>
  202.                 <xsl:apply-templates select="@currentDateTimeValue"/>
  203.         </fo:block>
  204.         
  205.         
  206. </xsl:template>
  207.  
  208.  
  209. <!-- ========================================== Task List ========================================== -->
  210. <xsl:template match="ganttproject:tasks">
  211.     <fo:block font-size="20pt"
  212.               line-height="16pt"
  213.               background-color="#145277"
  214.               color="white"
  215.               space-after.optimum="15pt"
  216.               text-align="center"
  217.               padding-top="8pt"
  218.               padding-bottom="8pt"
  219.               break-before="page">
  220.         <xsl:attribute name="font-family">
  221.             <xsl:value-of select="$font"/>
  222.         </xsl:attribute>
  223.         <xsl:apply-templates select="@title"/>
  224.     </fo:block>
  225.     
  226.     
  227.     <fo:block space-after.optimum="0pt" font-size="10pt" padding-bottom="30pt">
  228.         <xsl:attribute name="font-family">
  229.             <xsl:value-of select="$font"/>
  230.         </xsl:attribute>
  231.  
  232.         <fo:table>
  233.             <fo:table-column column-width="4cm"/>    <!--Name-->
  234.             <fo:table-column column-width="2cm"/>    <!--Begin-->
  235.             <fo:table-column column-width="2cm"/>    <!--End-->
  236.             <fo:table-column column-width="1cm"/>    <!--Milestone-->
  237.             <fo:table-column column-width="1cm"/>    <!--Percent-complete-->
  238.             <fo:table-column column-width="3cm"/>    <!--Affecter-->
  239.             <fo:table-column column-width="4.5cm"/>    <!--Notes-->            
  240.             <fo:table-body>
  241.                 <fo:table-row>
  242.                     <fo:table-cell>
  243.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  244.                             <xsl:apply-templates select="@name"/>
  245.                         </fo:block>
  246.                     </fo:table-cell>
  247.                     <fo:table-cell>
  248.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  249.                             <xsl:apply-templates select="@begin"/>
  250.                         </fo:block>
  251.                     </fo:table-cell>
  252.                     <fo:table-cell>
  253.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  254.                             <xsl:apply-templates select="@end"/>
  255.                         </fo:block>
  256.                     </fo:table-cell>
  257.                     <fo:table-cell>
  258.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  259.                             <xsl:apply-templates select="@milestone"/>
  260.                         </fo:block>
  261.                     </fo:table-cell>
  262.                     <fo:table-cell>
  263.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  264.                             <xsl:apply-templates select="@progress"/>
  265.                         </fo:block>
  266.                     </fo:table-cell>
  267.                     <fo:table-cell>
  268.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  269.                             <xsl:apply-templates select="@assigned-to"/>
  270.                         </fo:block>
  271.                     </fo:table-cell>
  272.                     <fo:table-cell>
  273.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  274.                             <xsl:apply-templates select="@notes"/>
  275.                         </fo:block>
  276.                     </fo:table-cell>
  277.                 </fo:table-row>
  278.             
  279.                 
  280.                 
  281.                 <xsl:for-each select="ganttproject:task">
  282.                                     
  283.                             <fo:table-row>
  284.                                 <fo:table-cell>
  285.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt" text-align="left">
  286.                                         <xsl:attribute name="background-color"><xsl:value-of select="color"/></xsl:attribute>
  287.                                         <xsl:value-of select="name"/>
  288.                                     </fo:block>
  289.                                 </fo:table-cell>
  290.                                 <fo:table-cell>
  291.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt" text-align="left">
  292.                                         <xsl:attribute name="background-color"><xsl:value-of select="color"/></xsl:attribute>
  293.                                         <xsl:value-of select="begin"/>
  294.                                     </fo:block>
  295.                                 </fo:table-cell>
  296.                                 <fo:table-cell>
  297.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt" text-align="left">
  298.                                         <xsl:attribute name="background-color"><xsl:value-of select="color"/></xsl:attribute>
  299.                                         <xsl:value-of select="end"/>
  300.                                     </fo:block>
  301.                                 </fo:table-cell>
  302.                                 <fo:table-cell>
  303.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt">
  304.                                         <xsl:attribute name="background-color"><xsl:value-of select="color"/></xsl:attribute>
  305.                                         <xsl:value-of select="milestone"/>
  306.                                     </fo:block>
  307.                                 </fo:table-cell>
  308.                                 <fo:table-cell>
  309.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt">
  310.                                         <xsl:attribute name="background-color"><xsl:value-of select="color"/></xsl:attribute>
  311.                                         <xsl:value-of select="progress"/>
  312.                                     </fo:block>
  313.                                 </fo:table-cell>
  314.                                 <fo:table-cell>
  315.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt">
  316.                                         <xsl:attribute name="background-color"><xsl:value-of select="color"/></xsl:attribute>
  317.                                         <xsl:value-of select="assigned-to"/>
  318.                                     </fo:block>
  319.                                 </fo:table-cell>
  320.                                 <fo:table-cell>
  321.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt" text-align="left">
  322.                                         <xsl:attribute name="background-color"><xsl:value-of select="color"/></xsl:attribute>
  323.                                         <xsl:value-of select="notes"/>
  324.                                     </fo:block>
  325.                                 </fo:table-cell>
  326.                             </fo:table-row>
  327.                         
  328.  
  329.                 </xsl:for-each>
  330.                 
  331.             </fo:table-body>
  332.         </fo:table>
  333.                         
  334.     </fo:block>
  335.     
  336. </xsl:template>
  337.  
  338. <!-- ========================================== Resources List ========================================== -->
  339. <xsl:template match="ganttproject:resources">
  340.     <fo:block font-size="20pt"
  341.               line-height="16pt"
  342.               background-color="#145277"
  343.               color="white"
  344.               space-after.optimum="15pt"
  345.               text-align="center"
  346.               padding-top="8pt"
  347.               padding-bottom="8pt"
  348.               break-before="page">
  349.         <xsl:attribute name="font-family">
  350.             <xsl:value-of select="$font"/>
  351.         </xsl:attribute>
  352.         <xsl:apply-templates select="@title"/>
  353.     </fo:block>
  354.     
  355.     
  356.     <fo:block space-after.optimum="0pt" font-size="10pt"  padding-bottom="30pt">
  357.         <xsl:attribute name="font-family">
  358.             <xsl:value-of select="$font"/>
  359.         </xsl:attribute>
  360.  
  361.         <fo:table>
  362.             <fo:table-column column-width="4.5cm"/>    <!--Name-->
  363.             <fo:table-column column-width="4.5cm"/>    <!--Role-->
  364.             <fo:table-column column-width="4.5cm"/>    <!--Mail-->
  365.             <fo:table-column column-width="4cm"/>    <!--Phone-->
  366.             <fo:table-body>
  367.                 <fo:table-row>
  368.                     <fo:table-cell>
  369.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  370.                             <xsl:apply-templates select="@name"/>
  371.                         </fo:block>
  372.                     </fo:table-cell>
  373.                     <fo:table-cell>
  374.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  375.                             <xsl:apply-templates select="@role"/>
  376.                         </fo:block>
  377.                     </fo:table-cell>
  378.                     <fo:table-cell>
  379.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  380.                             <xsl:apply-templates select="@mail"/>
  381.                         </fo:block>
  382.                     </fo:table-cell>
  383.                     <fo:table-cell>
  384.                         <fo:block background-color="#1c84bc" color="white" font-size="11pt" space-after.optimum="0pt" space-before.optimum="0pt">
  385.                             <xsl:apply-templates select="@phone"/>
  386.                         </fo:block>
  387.                     </fo:table-cell>
  388.                 </fo:table-row>
  389.                 
  390.                 
  391.                 
  392.                 <xsl:for-each select="ganttproject:resource">
  393.                             <fo:table-row>
  394.                                 <fo:table-cell>
  395.                                     <fo:block  color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt" text-align="left">
  396.                                         <xsl:value-of select="name"/>
  397.                                     </fo:block>
  398.                                 </fo:table-cell>
  399.                                 <fo:table-cell>
  400.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt" text-align="left">
  401.                                         <xsl:value-of select="role"/>
  402.                                     </fo:block>
  403.                                 </fo:table-cell>
  404.                                 <fo:table-cell>
  405.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt">
  406.                                         <xsl:value-of select="mail"/>
  407.                                     </fo:block>
  408.                                 </fo:table-cell>
  409.                                 <fo:table-cell>
  410.                                     <fo:block color="black" font-size="9pt" space-after.optimum="0pt" space-before.optimum="0pt" line-height="13pt">
  411.                                         <xsl:value-of select="phone"/>
  412.                                     </fo:block>
  413.                                 </fo:table-cell>
  414.                             </fo:table-row>                    
  415.                 </xsl:for-each>
  416.                 
  417.             </fo:table-body>
  418.         </fo:table>            
  419.     </fo:block>
  420.     
  421. </xsl:template>
  422.  
  423. <!-- ========================================== GanttChart ========================================== -->
  424. <xsl:template match="ganttproject:ganttchart">
  425.     <fo:block font-size="20pt"
  426.               line-height="16pt"
  427.               background-color="#145277"
  428.               color="white"
  429.               space-after.optimum="15pt"
  430.               text-align="center"
  431.               padding-top="8pt"
  432.               padding-bottom="8pt"
  433.               break-before="page">
  434.         <xsl:attribute name="font-family">
  435.             <xsl:value-of select="$font"/>
  436.         </xsl:attribute>
  437.         <xsl:apply-templates select="@title"/>
  438.     </fo:block>
  439.     
  440.     <!-- Show the real chart from a picture -->
  441.     <fo:block text-align="right">
  442.         <fo:external-graphic>
  443.             <xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
  444.             <xsl:attribute name="height">24cm</xsl:attribute>
  445.         </fo:external-graphic>
  446.     </fo:block>
  447. </xsl:template>
  448.  
  449. <!-- ========================================== ResourcesCHART ========================================== -->
  450. <xsl:template match="ganttproject:resourceschart">
  451.     <fo:block font-size="20pt"
  452.               line-height="16pt"
  453.               background-color="#145277"
  454.               color="white"
  455.               space-after.optimum="15pt"
  456.               text-align="center"
  457.               padding-top="8pt"
  458.               padding-bottom="8pt"
  459.               break-before="page">
  460.         <xsl:attribute name="font-family">
  461.             <xsl:value-of select="$font"/>
  462.         </xsl:attribute>
  463.         <xsl:apply-templates select="@title"/>
  464.     </fo:block>
  465.     
  466.     <!-- Show the real chart from a picture -->
  467.     <fo:block text-align="right">
  468.         <fo:external-graphic>
  469.             <xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
  470.             <xsl:attribute name="height">24cm</xsl:attribute>
  471.         </fo:external-graphic>
  472.     </fo:block>
  473. </xsl:template>
  474.  
  475.  
  476. </xsl:stylesheet>
  477.